package com.flowable.candidate.strategy.user;

import com.common.utils.StrUtils;
import com.flowable.candidate.BpmTaskCandidateStrategy;
import com.flowable.common.enums.BpmTaskCandidateStrategyEnum;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Set;



/**
 * 用户组 {@link BpmTaskCandidateStrategy} 实现类
 *
 * @author kyle
 */
//@Component
//public class BpmTaskCandidateGroupStrategy implements BpmTaskCandidateStrategy {
//
//    @Resource
//    private BpmUserGroupService userGroupService;
//
//    @Override
//    public BpmTaskCandidateStrategyEnum getStrategy() {
//        return BpmTaskCandidateStrategyEnum.USER_GROUP;
//    }
//
////    @Override
////    public void validateParam(String param) {
////        Set<Long> groupIds = StrUtils.splitToLongSet(param);
////        userGroupService.validUserGroups(groupIds);
////    }
//
//    @Override
//    public Set<Long> calculateUsers(String param) {
//        Set<Long> groupIds = StrUtils.splitToLongSet(param);
//        List<BpmUserGroupDO> groups = userGroupService.getUserGroupList(groupIds);
//        return convertSetByFlatMap(groups, BpmUserGroupDO::getUserIds, Collection::stream);
//    }
//
//}